import request from '@/utils/request'

const prefixUrl = 'web/bill_sale_group/'

// 查询分组列表
export function list_by_dto(data) {
  return request({
    url: prefixUrl + 'list_by_dto',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}

// 根据到款id，查询分组列表
export function list_by_account_received_id(params) {
  return request({
    url: prefixUrl + 'list_by_account_received_id',
    method: 'get',
    params
  })
}

// 销售单穿梭框
export function saleList(params) {
  return request({
    url: prefixUrl + 'sale/list',
    method: 'get',
    params
  })
}

// 销售单穿梭框
export function saleListInGroup(params) {
  return request({
    url: prefixUrl + 'sale/list-in-group',
    method: 'get',
    params
  })
}

// 分组列表
export function list(params) {
  return request({
    url: prefixUrl + 'list',
    method: 'get',
    params
  })
}

// 关联
export function relation(data) {
  return request({
    url: prefixUrl + 'relation',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}

// 关联
export function getContractAndCustomerByGroupId(id) {
  return request({
    url: prefixUrl + 'getContractAndCustomerByGroupId',
    method: 'get',
    params: {
      group_id: id
    }
  })
}
